A typical client-server database system includes a client, a database server, and a database. The client portion includes two main components, a database application and a client driver interface. The database application issues database language commands, such as SQL (Structured Query Language) commands, and provides an interface to a user through a keyboard, screen, and pointing devices such as a mouse. The client driver interface, on the other hand, provides the connection and communication interface between the client and the database server.
A connection is a communication pathway between a client and a database server and a specific connection between a client and a database server is termed a database session. The database server responds to the database language commands sent from the client by executing database operations for accessing and manipulating a physical database. A logical unit of work that is comprised of one or more database language commands is often referred to as a transaction.
Contained within the database server is the session state data that reflects the current transaction state of the database session. To initiate a database session, a xe2x80x9clog onxe2x80x9d procedure may be performed to establish a new database session by connecting a client with a database server.
Normally, the database session lasts from the time the user connects until the time the user disconnects or exits the database application. However, if a database session failure occurs, the connection between the client and the database server is lost. Once the database session fails, the user will observe a visible interrupt in his service as access to the database is terminated. To continue accessing the database, the user must reconnect a client to an active database server. This may require human intervention to manually log back onto the system to establish a new database session.
Besides requiring human intervention to manually log back onto the system, the failure of a database session creates other significant problems to the user. Because the logon process creates a new database session, all previous transactions that were not complete at the time of the failure are lost. Thus the user must resubmit all lost transactions once the connection to the database is reestablished.
Based on the foregoing, it is desirable to provide a mechanism for handling the failure of a database session without requiring someone to perform manual reconnection steps. Additionally, it is also desirable for users not to lose session state data on the occurrence of a database session failure.
A method, system, and apparatus is provided for passing a client from a first server to which the client was connected for accessing a resource, to a second server for accessing the resource. While executing, the first server ceases to respond to the client. After the client detects that the first server has ceased to respond to the client, the client is automatically connected with the second server that has access to the resource. After automatically connecting the client, the client accesses the resource through the second server. In one embodiment, the client stores information about the state of the session with the first server so that processing can continue where it left off after the client connects with the second server. The client may be pre-connected to the second server prior to the failure of the first server to reduce the latency caused by switching in response to a failure. The second server may be configured to pre-parse the commands that the client issues to the first server to further reduce the latency associated with switching to the second server.